import { createRouter, createWebHistory } from 'vue-router'
import Login from '@/views/login/LoginPage.vue'
import Layout from '@/views/layout/Layout.vue'
import UserProfile from '@/views/user/UserProfile.vue'
import ArticleChannel from '@/views/article/ArticleChannel.vue'
import ArticleManage from '@/views/article/ArticleManage.vue'
import UserAvatar from '@/views/user/UserAvatar.vue'
import UserPassword from '@/views/user/UserPassword.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/login', component: Login
    }, {
      // path: '/', component: Layout, redirect: '/article/channel', children: [{
      path: '/', component: Layout, redirect: '/login', children: [{
        path: '/article/manage', component: ArticleManage
      }, {
        path: '/article/channel', component: ArticleChannel
      }, {
        path: '/user/profile', component: UserProfile
      }, {
        path: '/user/avatar', component: UserAvatar
      }, {
        path: '/user/password', component: UserPassword
      }]
    }
  ]
})

export default router
